Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "Determine emptier car location and crowding description"" #685

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

PaulJKim
Copy link
Collaborator

@PaulJKim PaulJKim commented Aug 31, 2023

Reverts #684

Errors were occurring in Dev because the multi_carriage_details field is still only in dev-green and that was causing get_crowding_description to attempt to call Enum.map(nil).

Adding a default of [] to the parsing logic. Tested against the prod RTR feed to make sure there are no errors.

@github-actions
Copy link

Coverage of commit 8ee13fb

Summary coverage rate:
  lines......: 75.4% (1893 of 2512 lines)
  functions..: 76.9% (517 of 672 functions)
  branches...: no data found

Files changed coverage rate:
                                                             |Lines       |Functions  |Branches    
  Filename                                                   |Rate     Num|Rate    Num|Rate     Num
  =================================================================================================
  lib/content/audio/approaching.ex                           |70.4%     27| 100%     7|    -      0
  lib/content/audio/predictions.ex                           |94.2%     52| 100%     1|    -      0
  lib/content/audio/train_is_arriving.ex                     |48.4%     31| 100%     5|    -      0
  lib/content/message/predictions.ex                         |56.7%    120|66.7%    15|    -      0
  lib/engine/locations.ex                                    |61.4%     57|66.7%    15|    -      0

Download coverage report

Copy link
Collaborator

@panentheos panentheos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment, then looks good.

)
(location["vehicle"]["multi_carriage_details"] &&
Enum.map(
location["vehicle"]["multi_carriage_details"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: If we do location["vehicle"]["multi_carriage_details"] || [], we could remove the outer guard and map over it unconditionally, which might be a little cleaner.

@github-actions
Copy link

Coverage of commit 8ee13fb

Summary coverage rate:
  lines......: 75.3% (1891 of 2512 lines)
  functions..: 76.9% (517 of 672 functions)
  branches...: no data found

Files changed coverage rate:
                                                             |Lines       |Functions  |Branches    
  Filename                                                   |Rate     Num|Rate    Num|Rate     Num
  =================================================================================================
  lib/content/audio/approaching.ex                           |70.4%     27| 100%     7|    -      0
  lib/content/audio/predictions.ex                           |94.2%     52| 100%     1|    -      0
  lib/content/audio/train_is_arriving.ex                     |48.4%     31| 100%     5|    -      0
  lib/content/message/predictions.ex                         |56.7%    120|66.7%    15|    -      0
  lib/engine/locations.ex                                    |60.3%     58|66.7%    15|    -      0

Download coverage report

@github-actions
Copy link

Coverage of commit e898a47

Summary coverage rate:
  lines......: 75.3% (1891 of 2511 lines)
  functions..: 76.9% (517 of 672 functions)
  branches...: no data found

Files changed coverage rate:
                                                             |Lines       |Functions  |Branches    
  Filename                                                   |Rate     Num|Rate    Num|Rate     Num
  =================================================================================================
  lib/content/audio/approaching.ex                           |70.4%     27| 100%     7|    -      0
  lib/content/audio/predictions.ex                           |94.2%     52| 100%     1|    -      0
  lib/content/audio/train_is_arriving.ex                     |48.4%     31| 100%     5|    -      0
  lib/content/message/predictions.ex                         |56.7%    120|66.7%    15|    -      0
  lib/engine/locations.ex                                    |61.4%     57|66.7%    15|    -      0

Download coverage report

@PaulJKim PaulJKim merged commit 72220b4 into main Aug 31, 2023
1 check passed
@PaulJKim PaulJKim deleted the revert-684-revert-677-pk/crowding-status-determination branch August 31, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants